from datetime import datetime

from game.models import PlatformRecord


class Plattime(object):
    def __init__(self):
        self.plat = PlatformRecord.objects.all().order_by('-add_time').first()
    def timers(self):
        # print(plat.nper)
        zy = self.plat.nper.split('-')[-1]
        xy = str(int(zy))
        if len(xy) == 1:
            xy = "00" + xy
        elif len(xy) == 2:
            xy = "0" + xy

        count = int(xy)
        times = datetime.now()
        tes = times.strftime('%Y-%m-%d')
        while (count < 1000):
            count = count + 1
            timesr = str(tes + "-%s" % (count))
            return timesr

Plattime().timers()